package observer.improve;

public class Client {
    public static void main(String[] args) {
        WeatherDataSubject subject = new WeatherDataSubject();
        ThirdPartObserver thirdPartObserver = new ThirdPartObserver(subject);
        BaiduSiteObserver baiduSiteObserver = new BaiduSiteObserver(subject);
        System.out.println("通知各个注册的观察者, 看看信息");
        subject.updateTemperature(10f, 100f, 30.3f);

        // 移除一个观察者
        subject.removeObserver(thirdPartObserver);
        System.out.println("移除了第三方网站的接入，再看信息");
        subject.updateTemperature(15f, 130f, 35f);

    }
}
